package com.qdu.servlet;

import com.qdu.dao.ActivityDao;
import com.qdu.entity.Activity;
import java.io.IOException;
import java.util.List;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * 从发表日志页面通过关键词查找活动
 *
 * @author Lenovo
 */
@WebServlet("/psas")
public class publishSearchActServlet extends HttpServlet{

    ActivityDao actdao=new ActivityDao();
    
    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        
        String name=req.getParameter("name");
        List<Activity> list=actdao.getActivityByKeywordIncludeCover(name);//通过关键词查询活动列表
        if(null==list)
        {
            resp.sendRedirect("bpls");
        }
        else{
            req.setAttribute("list",list);
            req.getRequestDispatcher("keywordActNewLog.jsp").forward(req, resp);
        }
}

    
}
